package com.zan.springcloud.controller;

import com.zan.springcloud.domain.CommonResult;
import com.zan.springcloud.domain.Order;
import com.zan.springcloud.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author Zan
 * @Create 2024/1/7 15:06
 * @Description :
 */
@RestController
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping(value = "/order/create") // 这是对浏览器来说的，浏览器只能发送Get请求
    public CommonResult create(Order order) {
        orderService.create(order);
        return new CommonResult(200, "订单创建成功");
    }

}
